home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Tool Chest / Interfaces / MPW Interfaces / CIncludes / Menus.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  5.9 KB  |  215 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Menus.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __MENUS__
  13. #define __MENUS__
  14.  
  15. #ifndef __QUICKDRAW__
  16. #include <Quickdraw.h>
  17. #endif
  18.  
  19.  
  20. enum {
  21.  
  22.  
  23. #define noMark '\0'        /*mark symbol for MarkItem*/
  24.  
  25. /* menu defProc messages */
  26.  
  27.  mDrawMsg = 0,
  28.  mChooseMsg = 1,
  29.  mSizeMsg = 2,
  30.  mDrawItemMsg = 4,
  31.  mCalcItemMsg = 5,
  32.  textMenuProc = 0,
  33.  hMenuCmd = 27,            /*itemCmd == 0x001B ==> hierarchical menu*/
  34.  hierMenu = -1,            /*a hierarchical menu - for InsertMenu call*/
  35.  mPopUpMsg = 3,            /*menu defProc messages - place yourself*/
  36.  mctAllItems = -98,        /*search for all Items for the given ID*/
  37.  mctLastIDIndic = -99    /*last color table entry has this in ID field*/
  38. };
  39.  
  40. struct MenuInfo {
  41.  short menuID;
  42.  short menuWidth;
  43.  short menuHeight;
  44.  Handle menuProc;
  45.  long enableFlags;
  46.  Str255 menuData;
  47. };
  48.  
  49. typedef struct MenuInfo MenuInfo;
  50. typedef MenuInfo *MenuPtr, **MenuHandle;
  51.  
  52. struct MCEntry {
  53.  short mctID;            /*menu ID.  ID = 0 is the menu bar*/
  54.  short mctItem;            /*menu Item. Item = 0 is a title*/
  55.  RGBColor mctRGB1;        /*usage depends on ID and Item*/
  56.  RGBColor mctRGB2;        /*usage depends on ID and Item*/
  57.  RGBColor mctRGB3;        /*usage depends on ID and Item*/
  58.  RGBColor mctRGB4;        /*usage depends on ID and Item*/
  59.  short mctReserved;        /*reserved for internal use*/
  60. };
  61.  
  62. typedef struct MCEntry MCEntry;
  63. typedef MCEntry *MCEntryPtr;
  64.  
  65.  
  66. typedef MCEntry MCTable[1], *MCTablePtr, **MCTableHandle;
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. struct MenuCRsrc {
  75.  short numEntries;        /*number of entries*/
  76.  MCTable mcEntryRecs;    /*ARRAY [1..numEntries] of MCEntry*/
  77. };
  78.  
  79. typedef struct MenuCRsrc MenuCRsrc;
  80. typedef MenuCRsrc *MenuCRsrcPtr, **MenuCRsrcHandle;
  81.  
  82.  
  83. #ifdef __cplusplus
  84. extern "C" {
  85. #endif
  86. pascal void InitMenus(void)
  87.  = 0xA930; 
  88. pascal MenuHandle NewMenu(short menuID,const Str255 menuTitle)
  89.  = 0xA931; 
  90. pascal MenuHandle GetMenu(short resourceID)
  91.  = 0xA9BF; 
  92. pascal void DisposeMenu(MenuHandle theMenu)
  93.  = 0xA932; 
  94. pascal void AppendMenu(MenuHandle menu,ConstStr255Param data)
  95.  = 0xA933; 
  96. pascal void AddResMenu(MenuHandle theMenu,ResType theType)
  97.  = 0xA94D; 
  98. pascal void AppendResMenu(MenuHandle theMenu,ResType theType)
  99.  = 0xA94D; 
  100. pascal void InsertResMenu(MenuHandle theMenu,ResType theType,short afterItem)
  101.  = 0xA951; 
  102. pascal void InsertMenu(MenuHandle theMenu,short beforeID)
  103.  = 0xA935; 
  104. pascal void DrawMenuBar(void)
  105.  = 0xA937; 
  106. pascal void InvalMenuBar(void)
  107.  = 0xA81D; 
  108. pascal void DeleteMenu(short menuID)
  109.  = 0xA936; 
  110. pascal void ClearMenuBar(void)
  111.  = 0xA934; 
  112. pascal Handle GetNewMBar(short menuBarID)
  113.  = 0xA9C0; 
  114. pascal Handle GetMenuBar(void)
  115.  = 0xA93B; 
  116. #define GetMBarHeight() (* (short*) 0x0BAA)
  117. pascal void SetMenuBar(Handle menuList)
  118.  = 0xA93C; 
  119. pascal void InsMenuItem(MenuHandle theMenu,ConstStr255Param itemString,
  120.  short afterItem)
  121.  = 0xA826; 
  122. pascal void InsertMenuItem(MenuHandle theMenu,ConstStr255Param itemString,
  123.  short afterItem)
  124.  = 0xA826; 
  125. pascal void DelMenuItem(MenuHandle theMenu,short item)
  126.  = 0xA952; 
  127. pascal void DeleteMenuItem(MenuHandle theMenu,short item)
  128.  = 0xA952; 
  129. pascal long MenuKey(short ch)
  130.  = 0xA93E; 
  131. pascal void HiliteMenu(short menuID)
  132.  = 0xA938; 
  133. pascal void SetItem(MenuHandle theMenu,short item,ConstStr255Param itemString)
  134.  = 0xA947; 
  135. pascal void SetMenuItemText(MenuHandle theMenu,short item,ConstStr255Param itemString)
  136.  = 0xA947; 
  137. pascal void GetItem(MenuHandle theMenu,short item,Str255 itemString)
  138.  = 0xA946; 
  139. pascal void GetMenuItemText(MenuHandle theMenu,short item,Str255 itemString)
  140.  = 0xA946; 
  141. pascal void DisableItem(MenuHandle theMenu,short item)
  142.  = 0xA93A; 
  143. pascal void EnableItem(MenuHandle theMenu,short item)
  144.  = 0xA939; 
  145. pascal void CheckItem(MenuHandle theMenu,short item,Boolean checked)
  146.  = 0xA945; 
  147. pascal void SetItemMark(MenuHandle theMenu,short item,short markChar)
  148.  = 0xA944; 
  149. pascal void GetItemMark(MenuHandle theMenu,short item,short *markChar)
  150.  = 0xA943; 
  151. pascal void SetItemIcon(MenuHandle theMenu,short item,short iconIndex)
  152.  = 0xA940; 
  153. pascal void GetItemIcon(MenuHandle theMenu,short item,short *iconIndex)
  154.  = 0xA93F; 
  155. pascal void SetItemStyle(MenuHandle theMenu,short item,short chStyle)
  156.  = 0xA942; 
  157. pascal void GetItemStyle(MenuHandle theMenu,short item,Style *chStyle); 
  158. pascal void CalcMenuSize(MenuHandle theMenu)
  159.  = 0xA948; 
  160. pascal short CountMItems(MenuHandle theMenu)
  161.  = 0xA950; 
  162. pascal MenuHandle GetMHandle(short menuID)
  163.  = 0xA949; 
  164. pascal MenuHandle GetMenuHandle(short menuID)
  165.  = 0xA949; 
  166. pascal void FlashMenuBar(short menuID)
  167.  = 0xA94C; 
  168. pascal void SetMenuFlash(short count)
  169.  = 0xA94A; 
  170. pascal long MenuSelect(Point startPt)
  171.  = 0xA93D; 
  172. pascal void InitProcMenu(short resID)
  173.  = 0xA808; 
  174. pascal void GetItemCmd(MenuHandle theMenu,short item,short *cmdChar)
  175.  = 0xA84E; 
  176. pascal void SetItemCmd(MenuHandle theMenu,short item,short cmdChar)
  177.  = 0xA84F; 
  178. pascal long PopUpMenuSelect(MenuHandle menu,short top,short left,short popUpItem)
  179.  = 0xA80B; 
  180. pascal long MenuChoice(void)
  181.  = 0xAA66; 
  182. pascal void DelMCEntries(short menuID,short menuItem)
  183.  = 0xAA60; 
  184. pascal void DeleteMCEntries(short menuID,short menuItem)
  185.  = 0xAA60; 
  186. pascal MCTableHandle GetMCInfo(void)
  187.  = 0xAA61; 
  188. pascal void SetMCInfo(MCTableHandle menuCTbl)
  189.  = 0xAA62; 
  190. pascal void DispMCInfo(MCTableHandle menuCTbl)
  191.  = 0xAA63; 
  192. pascal void DisposeMCInfo(MCTableHandle menuCTbl)
  193.  = 0xAA63; 
  194. pascal MCEntryPtr GetMCEntry(short menuID,short menuItem)
  195.  = 0xAA64; 
  196. pascal void SetMCEntries(short numEntries,MCTablePtr menuCEntries)
  197.  = 0xAA65; 
  198. pascal void InsertFontResMenu(MenuHandle theMenu, short afterItem,
  199.                 short scriptFilter)
  200.  = {0x303C, 0x0400, 0xA825};
  201. pascal void InsertIntlResMenu(MenuHandle theMenu, ResType theType,
  202.                 short afterItem, short scriptFilter)
  203.  = {0x303C, 0x0601, 0xA825};
  204. MenuHandle newmenu(short menuID,char *menuTitle); 
  205. void getitem(MenuHandle menu,short item,char *itemString); 
  206. void appendmenu(MenuHandle menu,char *data); 
  207. void insmenuitem(MenuHandle theMenu,char *itemString,short afterItem); 
  208. long menuselect(Point *startPt); 
  209. void setitem(MenuHandle menu,short item,char *itemString); 
  210. #ifdef __cplusplus
  211. }
  212. #endif
  213.  
  214. #endif
  215.